int numDecodings(char * s){
    if (s[0] == '0') return 0;
    int pre = 1; 
    int current = 1;
    for (int i = 1; i < strlen(s); i++) {
        int temp = current;
        if (s[i] == '0') {
            if (s[i - 1] != '1' && s[i - 1] != '2') return 0;
            current = pre;
        } else if (s[i - 1] == '1' || (s[i - 1] == '2' && s[i] <= '6')) {
            current += pre;
        }
        pre = temp; 
    }
    return current;
}